/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dao;

import java.util.ArrayList;
import model.entidades.Refresco;
import model.util.HibernateUtil;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 *
 * @author Administrador
 */
public class RefrescoDAOImpl implements RefrescoDAO{
    Transaction transaccion;
    Session s;

    public ArrayList<Refresco> listar() {
        try {
             s = HibernateUtil.getSessionFactory().getCurrentSession();
             transaccion=s.beginTransaction();
            return (ArrayList<Refresco>)s.createQuery("From Refresco").list();
        } catch (Exception e) {
        return null;
        }
    }
}
